package com.motong.gongdan.entity;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.*;
import com.motong.gongdan.vo.system.otherVo.CustomFieldVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author:fff
 * @time:2022/2/23
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel(description = "产品表单")
@TableName("product")
@Accessors(chain = true)
public class Product extends PublicPo {
    @ApiModelProperty(value = "id值，编辑删除时必传", name = "id", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private String code;
    private String name;
    @ApiModelProperty(value = "单位id", name = "unitId", example = "1")
    @TableField("unit_id")
    private Integer unitId;
    @ApiModelProperty(value = "规格", name = "specification", example = "")
    private String specification;
    @ApiModelProperty(value = "工艺路线id", name = "processRouteId", example = "")
    @TableField(value = "process_route_id", updateStrategy = FieldStrategy.IGNORED)
    private Integer processRouteId;
    @ApiModelProperty(value = "库存数量", name = "stock", example = "")
    private BigDecimal stock;
    @ApiModelProperty(value = "创建人id", name = "createId", example = "")
    @TableField("create_id")
    private Integer createId;
    @ApiModelProperty(value = "删除状态 0/1 正常/删除", name = "delFlag", example = "")
    @TableField("del_flag")
    private Integer delFlag;
    @ApiModelProperty(value = "不传")
    @TableField("create_time")
    private Date createTime;
    @ApiModelProperty(value = "不传")
    @TableField("update_time")
    private Date updateTime;
    @TableField(updateStrategy = FieldStrategy.IGNORED, value = "other")
    private String other;

    @ApiModelProperty(value = "不传")
    @TableField(exist = false)
    private String createName;

    @TableField(exist = false)
    private String processRouteName;
    @TableField(exist = false)
    private String unitName;

    @TableField(updateStrategy = FieldStrategy.IGNORED, value = "minimum")
    private BigDecimal minimum;
    @TableField(updateStrategy = FieldStrategy.IGNORED, value = "maximum")
    private BigDecimal maximum;
    @TableField(updateStrategy = FieldStrategy.IGNORED, value = "safe")
    private BigDecimal safe;
    @TableField("now_num")
    private BigDecimal nowNum;
    @TableField("attribute")
    private Integer attribute;

    @ApiModelProperty("二维码")
    @TableField("qr")
    private String qr;

    @ApiModelProperty("单价")
    @TableField("unit_price")
    private BigDecimal unitPrice;

    @TableField(exist = false)
    private BigDecimal handleNum;

    @TableField(exist = false)
    private String attributeName;

    @TableField(exist = false)
    private List<CustomFieldVo> customFieldVos;

    @TableField(exist = false)
    private JSONArray customFieldMess;


}

